package com.foreknow.demo5;

import java.util.Scanner;

public class D {
    public Animal a() {
        Animal Ani1 = new Animal();
        Ani1.name = "dog";
        return Ani1;
    }

    public void b(Animal animal) {
        System.out.println(animal.name+"--"+animal.sex+"--"+animal.color+"--"+animal.aniid);
    }

    public static void main(String[] args) {
          D d = new D();
//        Animal animal = d.a();
//        System.out.println(animal.name);

        Scanner input = new Scanner(System.in);
        System.out.println("请输入姓名：");
        String name = input.next();
        System.out.println("请输入性别：");
        String sex = input.next();
        System.out.println("请输入颜色：");
        String color = input.next();
        System.out.println("请输入编号：");
        int aniid = input.nextInt();

        Animal ani = new Animal();
        ani.name = name;
        ani.sex = sex;
        ani.color = color;
        ani.aniid = aniid;
        d.b(ani);
    }
}








